<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/css.css">
<script src="js/flexible.js"></script>
<script src="js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="js/layer.js"></script>
<script src="js/common.js"></script>
<script type="text/javascript">
  isLogin();
</script>
</head>
<body class="jui_bg_zhuse">
<!-- 头部 -->
<div class="jui_top_bar">
     <a class="jui_top_left" href="javascript:history.back(-1)"><img src="icons/back_111.png"></a>
     <div class="jui_top_middle">收款详情</div>
</div>
<!-- 头部end -->
<!-- 主体 -->
<div class="jui_public_tit jui_fc_lightzs">众筹信息 (<span id="status"></span>) </div>
<div class="jui_pad_l16 jui_pad_r16">
     <div class="jui_bg_ztqian jui_pad_1216 jui_bor_rad_5 jui_line_h14">
          <p class="jui_fc_lightzs">姓名：<span id="m_name"></span></p>
          <p class="jui_fc_lightzs">手机号：<span id="m_phone"></span></p>
     </div>
     <div class="jui_h16"></div>
     <div class="jui_bg_ztqian jui_pad_20 jui_bor_rad_5 jui_flex_col_center jui_line_h15">
          <img class="jihuo_ewm" src="" id="p_img"alt="">
          <div class="jui_h12"></div>
          <p class="jui_fc_lightzs"><span  class="p_status"></span>二维码</p>
          <p class="jui_fc_lightzs"><span class="p_status"></span>账号：<span class="jui_fc_lan" id="p_num"></span></p>
          <p class="jui_fc_lightzs">付款金额：<span class="jui_fc_lan" id="price">=</span>元</p>
     </div>
     <div class="jui_h16"></div>
      <div class="jui_bg_ztqian jui_flex_col_center jui_pad_20 jui_bor_rad_5">
           <img class="jihuo_ewm" src="" id="l_pay_img" alt="">
           <div class="jui_h12"></div>
           <p class="jui_fc_lightzs" id="pingzheng"></p>
      </div>
</div>
<div class="jui_public_btn"><input type="button" value="我已收款" id="btn"></div>
<!-- 主体end -->
<script type="text/javascript">
  $(function() {
    var arr = ['未打款', '已打款', '已完成'];
    var brr = ['等待对方打款', '付款凭证，点击查看', '付款凭证，点击查看'];
    var req = {uid: localStorage.getItem('h_uid'), token: localStorage.getItem('h_token'), up_id: window.location.search.split('=')[1]};
    $.ajax({type: 'post', url: baseURL + '/index.php?m=plan&c=suser_order_info', data: req, success: function(data) {
      data = JSON.parse(data);
      if(data.code != 200) {
        setTimeout(()=> {
          window.history.back(-1)
        }, 1000)
        layer.open({
          content: data.msg,
          skin: 'msg',
          time: 1
        })
        return;
      }
      $("#m_name").html(data.s_user.m_name);
      $("#m_phone").html(data.s_user.m_phone);
      $("#p_img").attr('src', data.w_pay.p_img);
      if(data.w_pay.p_status == '1') {
        $(".p_status").html('支付宝')
      } else{
        $(".p_status").html('微信')
      }
      $("#p_num").html(data.w_pay.p_num);
      $("#price").html(data.order_desc.price);
      $("#l_pay_img").attr('src', data.order_desc.l_pay_img);
      $("#pingzheng").html(brr[data.order_desc.status]);
      $("#status").html(arr[data.order_desc.status]);
      if(data.order_desc.status == 2 || data.order_desc.status == 0) {
        $("#btn").css({display: 'none'});
      } 
    }})
    $("#btn").on('click', function(data) {
      layer.open({
  title: [
    '提示',
  ]
  ,anim: 'up'
  ,content: '确认收到打款吗'
  ,btn: ['确认', '取消'],
  yes: ()=> {
    $.ajax({type: 'post', url: baseURL + '/index.php?m=plan&c=query_over', data: req, success: function(data) {
      data = JSON.parse(data);
      if(data.code != 200) {
        layer.open({
          content: data.msg,
          time: 1,
          skin: 'msg'
        })
        return;
      }
      setTimeout(()=> {
        window.history.back(-1);
      }, 1000)
      layer.open({
        content: data.msg,
        time: 1,
        skin: 'msg'
      })
    }})
  }
});
    })
  })
</script>
</body>
</html>
